﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Tomahawk.Runtime.Console.Commands
{
    public class TimeSpeedCommand : ConsoleCommand
    {
        public override string GetName()
        {
            return "timespeed";
        }

        public override string GetHelp()
        {
            return "Usage: timespeed speed.\nScales game simulation time";
        }

        public override string Execute(string[] parameters)
        {
            float timeSpeed = Engine.Instance.TimeSpeed;
            if (parameters.Count() > 1)
            {
                float.TryParse(parameters[1], out timeSpeed);
                Engine.Instance.TimeSpeed = timeSpeed;
            }

            return "Time Speed: " + Engine.Instance.TimeSpeed.ToString();
        }
    }
}
